export function setAccessToken(accessToken) {
    localStorage.setItem("accessToken", accessToken)
}

export function getAccessToken() {
    return localStorage.getItem("accessToken")
}

export function setRefreshToken(refreshToken) {
    localStorage.setItem("refreshToken", refreshToken)
}

export function getRefreshToken() {
    return localStorage.getItem("refreshToken")
}

export function setTabViewData(tabViewData) {
    localStorage.setItem("tabViewData", JSON.stringify(tabViewData))
}

export function getTabViewData() {
    let tabViewData = localStorage.getItem("tabViewData")
    if (tabViewData && tabViewData !== 'undefined') return JSON.parse(tabViewData)
    return []
}

//退出登录后，清空缓存
export function logOutRemoveCache() {
    setAccessToken('')
    setRefreshToken('')
    setTabViewData('')
}



